<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        div{
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div id="test"></div>
    <button type="button" onclick="changeColor()">点击按钮修改样式</button>
</body>
<script type="text/javascript">
    function changeColor(){
        var obj = document.getElementById("test");
        obj.style.backgroundColor = "blue";
    }
</script>
</html>